﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; Charset=gb2312">
    <meta http-equiv="Content-Language" content="zh-CN">
    <title>分类文章专栏</title>

    {{template "comm/link.html"}}

    <!--本页样式表-->
    <link href="/static/css/article.css" rel="stylesheet" />
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">

    <style>
        .article a{
            color: #67b3ef;
        }
    </style>
</head>
<body>
    <!-- 导航 -->
    {{template "comm/nav.html" .}}

    <!-- 主体（一般只改变这里的内容） -->
    <div class="blog-body" id="appVue">
        <div class="blog-container">
            <blockquote class="layui-elem-quote sitemap layui-breadcrumb shadow">
                <a href="/" title="网站首页">网站首页</a>
                <a href="/home/article" title="文章专栏">文章专栏</a>
                <a><cite>分类</cite></a>
                <a><cite>{{.Cate.Name}}</cite></a>
            </blockquote>
            <div class="blog-main">

                <!--左边栏-->
                <div class="blog-main-left">
                    {{range $index, $elem := .Articles}}
                        <div class="article shadow">
                            <div class="article-right">
                                <div class="article-title">
                                    <a href="/home/article/{{$elem.ID}}" style="font-size: 22px">{{$elem.Title}}</a>
                                </div>
                                <div class="article-abstract">
                                    {{$elem.Desc}}
                                </div>
                            </div>
                            <div class="clear"></div>
                            <div class="article-footer">
                                <span><i class="fa fa-clock-o"></i>&nbsp;&nbsp;  {{dateformat $elem.CreatedAt "2006/01/02 15:04:05"}}</span>
                                <span class="article-author"><i class="fa fa-user"></i>&nbsp;&nbsp;tingyu</span>
                                <span><i class="fa fa-tag"></i>&nbsp;&nbsp;<a href="#">{{$elem.Category.Name}}</a></span>
                                <span class="article-viewinfo"><i class="fa fa-eye"></i>&nbsp; {{$elem.PageView}}</span>
                                {{/*<span class="article-viewinfo"><i class="fa fa-commenting"></i>&nbsp;4</span>*/}}
                            </div>
                        </div>
                    {{end}}

                    <!--分页-->
                    <nav aria-label="Page navigation">
                        <ul class="pagination">
                            {{if gt .PageNum 1}}
                                <li class="page-item">
                                    <a class="page-link" href="/home/category/{{$.Cate.ID}}/artlist?pagenum={{Add .PageNum -1}}" aria-label="Previous">
                                        <span aria-hidden="true">上一页</span>
                                    </a>
                                </li>
                            {{else}}
                                <li class="page-item disabled">
                                    <a class="page-link" href="#" aria-label="Previous">
                                        <span aria-hidden="true">上一页</span>
                                    </a>
                                </li>
                            {{end}}

                            {{range $index, $val := .pStartToEnd}}
                                <li class="page-item {{if eq $val $.PageNum}}active{{end}}"><a class="page-link" href="/home/category/{{$.Cate.ID}}/artlist?pagenum={{$val}}">{{$val}}</a></li>
                            {{end}}

                            {{if lt .PageNum .PageCount}}
                                <li class="page-item">
                                    <a class="page-link" href="/home/category/{{$.Cate.ID}}/artlist?pagenum={{Add .PageNum 1}}" aria-label="Next">
                                        <span aria-hidden="true">下一页</span>
                                    </a>
                                </li>
                            {{else}}
                                <li class="page-item disabled">
                                    <a class="page-link" href="#" aria-label="Next">
                                        <span aria-hidden="true">下一页</span>
                                    </a>
                                </li>
                            {{end}}
                        </ul>
                    </nav>

                </div>
                
                <!--右边栏-->
                <div class="blog-main-right">
{{/*                    <div class="blog-search">*/}}
{{/*                        <form class="layui-form" action="">*/}}
{{/*                            <div class="layui-form-item">*/}}
{{/*                                <div class="search-keywords  shadow">*/}}
{{/*                                    <input type="text" name="keywords" lay-verify="required" placeholder="输入关键词搜索" autocomplete="off" class="layui-input">*/}}
{{/*                                </div>*/}}
{{/*                                <div class="search-submit  shadow">*/}}
{{/*                                    <a class="search-btn" lay-submit="formSearch" lay-filter="formSearch"><i class="fa fa-search"></i></a>*/}}
{{/*                                </div>*/}}
{{/*                            </div>*/}}
{{/*                        </form>*/}}
{{/*                    </div>*/}}
                    <div class="article-category shadow">
                        <div class="article-category-title">分类导航</div>
                            {{range $index, $elem := .Categories}}
                                <a href="/home/category/{{$elem.ID}}/artlist" style="color: #67b3ef;font-weight: 500">{{$elem.Name}}</a>
                            {{end}}
                        <div class="clear"></div>
                    </div>


                    <!--右边悬浮 平板或手机设备显示-->
                    <div class="category-toggle"><i class="fa fa-chevron-left"></i></div>
                </div>
                <div class="clear"></div>


            </div>
        </div>
    </div>
    <!-- 底部 -->
    {{template "comm/footer.html"}}

    <!--侧边导航-->
    {{template "comm/sidebar.html"}}

    <!--分享窗体-->
{{/*    {{template "comm/sharewindow.html"}}*/}}


    {{template "comm/script.html"}}


    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.2/js/bootstrap.min.js"></script>


</body>
</html>